import React from "react";
import useSearchParams from "../../hooks/useSearchParams";

// 取 params 参数
// export default function Detail({
//   match: {
//     params: { id },
//   },
// }) {
//   return (
//     <div>
//       <h1>Detail - {id}</h1>
//     </div>
//   );
// }

export default function Detail(props) {
  const search = props.location.search;
  const searchParams = useSearchParams(search);
  console.log(searchParams, "@@");

  return (
    <div>
      <h1>Detail - {searchParams.id}</h1>
    </div>
  );
}
